#!/usr/bin/env python
# -*- coding:utf-8 -*-
from django.urls import path, include, re_path

from web.view import auction, account

urlpatterns = [
    # 后台登录
    path('login/', account.login, name='login'),
    ##################拍卖场系列###########
    # 拍卖场列表渲染
    path('auction/list/', auction.auction_list, name='auction_list'),
    # 拍卖场增加
    path('auction/add/', auction.auction_add, name='auction_add'),
    # 拍卖场删除
    re_path(r'^auction/delete/(?P<pk>\d+)/$', auction.auction_delete, name='auction_delete'),
    # 拍卖场编辑
    re_path(r'^auction/edit/(?P<pk>\d+)/$', auction.auction_edit, name='auction_edit'),
    ############# 拍品系列 #############
    re_path(r'^auction/item/list/(?P<auction_id>\d+)/$', auction.auction_item_list, name='auction_item_list'),
    re_path(r'^auction/item/add/(?P<auction_id>\d+)/$', auction.auction_item_add, name='auction_item_add'),
    re_path(r'^auction/item/edit/(?P<auction_id>\d+)/(?P<item_id>\d+)/$', auction.auction_item_edit,
            name='auction_item_edit'),
    re_path(r'^auction/item/delete/(?P<item_id>\d+)/$', auction.auction_item_delete, name='auction_item_delete'),
    ############### 拍卖品详细 #########
    re_path(r'^auction/item/detail/add/(?P<item_id>\d+)/$', auction.auction_item_detail_add,
            name='auction_item_detail_add'),
    re_path(r'^auction/item/detail/add/one/(?P<item_id>\d+)/$', auction.auction_item_detail_add_one,
            name='auction_item_detail_add_one'),
    re_path(r'auction/item/detail/delete/one/$', auction.auction_item_detail_delete_one,
            name='auction_item_detail_delete_one'),

    re_path(r'^auction/item/image/add/(?P<item_id>\d+)/$', auction.auction_item_image_add,
            name='auction_item_image_add'),
    re_path(r'^auction/item/image/add/one/(?P<item_id>\d+)/$', auction.auction_item_image_add_one,
            name='auction_item_image_add_one'),
    re_path(r'^auction/item/image/delete/one/$', auction.auction_item_image_delete_one,
            name='auction_item_image_delete_one'),

]
